import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { TypeOrmModule } from '@nestjs/typeorm';
import { BaseModule } from './modules/base/base.module';
import { SystemModule } from './modules/system/system.module';
import { SystemLoginService } from './modules/system/service/system.login.service';

@Module({
  imports: [
    TypeOrmModule.forRoot({
      type: 'mysql',
      host: '127.0.0.1',
      port: 3306,
      username: 'root',
      password: '123456',
      database: 'lvmx',
      // 自动建表 PS: 线上部署的时候不要使用，有可能导致数据丢失
      synchronize: true,
      entities: ['dist/modules/**/*.entity{.ts,.js}'],
    }),
    BaseModule,
    SystemModule,
  ],
  controllers: [AppController],
  providers: [AppService, SystemLoginService],
})
export class AppModule {}
